Skip to content

Web: app-web Learn navigation + Examples list - #165

Merged
JumpLink merged 2 commits into
mainfrom
web/app-web-learn-nav
Jul 4, 2026
Merged

Web: app-web Learn navigation + Examples list#165
JumpLink merged 2 commits into
mainfrom
web/app-web-learn-nav

Conversation

@JumpLink

@JumpLink JumpLink commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Phase 5 of the app-web Adwaita rewrite — turn the single-scroll Learn view into the master→detail structure of app-gnome's Learn (learn.blp): an AdwNavigationView with a landing page that pushes to the Tutorial or the Examples list. This completes the four real views (Learn, Editor, Debugger, GameConsole).

What's new

  • AdwLearnView (widgets/learn/learn-view.ts) — rewritten as the navigation container. A landing page (boxed list of "Tutorial" / "Examples" rows) pushes the Tutorial page (the generated @learn6502/learn HTML, unchanged) or the Examples page. Exposes hasVisibleSubpage / navigateBack() + a subpage-changed event — the web stand-in for the GNOME twin's hasVisibleSubpage + navigation.push/pop.
  • ExamplesList + ExampleListItem — web twins of app-gnome's widgets, rendering @learn6502/examples. Each card reuses earlier-phase widgets: the GameConsole Display for the memory-snapshot thumbnail (parsed from displayMemory hex, same as GNOME) and the Editor SourceView (read-only, copyable) for the code. Copy routes through learnController.dispatch("copy") into the editor.
  • Shell — the header back button (stubbed since phase 1) is wired to learnView.navigateBack() and revealed via updateLearnBackButton() when a Learn subpage is open and the Learn view is on screen (whole sidebar on desktop, active tab on mobile) — matching how the GNOME twin gates it.
  • SourceView gained a fillHeight property (default true for the editor; false for example cards, which size to content, capped in CSS).
  • app-web now depends on @learn6502/examples; adds the *.asm text loader + ambient declaration (mirroring app-gnome). No lockfile change (workspace-only dep).

Verification

Built with gjsify build --app browser and driven in a headless browser on desktop + mobile (screenshots captured):

  • Landing rows render; pushing Examples shows all three example cards with painted thumbnails and copyable source.
  • Copying an example loads it into the editor (+ toast).
  • The back button reveals/hides correctly and pops to the landing.
  • The Tutorial page renders the full tutorial.

A layout fix worth noting: the Learn slot carries the shell's .shell-view-slot class (display: block, specificity beats a bare learn-view rule), so the nav is given an explicit height: 100% rather than overriding its own flex layout — otherwise the position: absolute; inset: 0 pages collapse to 0 height.

gjsify tsc --noEmit clean; gjsify format --check clean.

Remaining: delete-Jekyll + GH-Pages deploy (the hard cutover — to be done with a go-ahead).

JumpLink added 2 commits July 4, 2026 11:09
Phase 5 of the app-web Adwaita rewrite: turn the single-scroll Learn view
into the master→detail structure of app-gnome's `Learn` (`learn.blp`) — an
`AdwNavigationView` with a landing page that pushes to the Tutorial or the
Examples list. This completes the four real views (Learn, Editor, Debugger,
GameConsole).

- `AdwLearnView` (`widgets/learn/learn-view.ts`): rewritten as the navigation
  container. A landing page (a boxed list of "Tutorial" / "Examples" rows)
  pushes the Tutorial page (the generated `@learn6502/learn` HTML, unchanged)
  or the Examples page. Exposes `hasVisibleSubpage` / `navigateBack()` and a
  `subpage-changed` event — the web stand-in for the GNOME twin's
  `hasVisibleSubpage` property + `navigation.push`/`pop`.
- `ExamplesList` + `ExampleListItem` (`widgets/learn/`): the web twins of
  app-gnome's `ExamplesList` / `ExampleListItem`, rendering `@learn6502/examples`.
  Each card REUSES the widgets from the earlier phases — the GameConsole
  `Display` for the memory-snapshot thumbnail (parsed from the example's
  `displayMemory` hex, same as GNOME) and the Editor `SourceView` (read-only,
  copyable) for the code. Copy routes through `learnController.dispatch("copy")`
  to load the program into the editor.
- Shell: the header back button (stubbed since phase 1) is wired to
  `learnView.navigateBack()` and revealed via `updateLearnBackButton()` when a
  Learn subpage is open AND the Learn view is on screen (the whole sidebar on
  desktop, the active tab on mobile) — matching how the GNOME twin gates it.
- `SourceView` gained a `fillHeight` property (default true for the editor;
  false for the example cards, which size to content, capped in CSS).
- app-web now depends on `@learn6502/examples`; adds the `*.asm` text loader +
  ambient module declaration (mirroring app-gnome) so example sources import
  as strings. No lockfile change (workspace-only dep).

Verified in a headless browser on desktop + mobile: the landing rows render,
pushing Examples shows all three example cards with painted thumbnails and
copyable source, copying an example loads it into the editor (+ toast), the
back button reveals/hides correctly and pops to the landing, and the Tutorial
page renders the full tutorial.
app-web's tsconfig uses an explicit `files` list, not `include`, so an ambient
`.d.ts` with no import/export (unreachable via the import closure) is only in
the program when listed there. `src/types/asm-module.d.ts` was missing from the
list, so the `*.asm` declaration was absent under a clean install and the
examples' `import … from "./snake.asm"` failed type-check on CI (TS2307) while
passing locally off a stale node_modules where the examples package's own
`env.d.ts` happened to be reachable. Register it beside `html-module.d.ts`.
@JumpLink
JumpLink merged commit d8d51f1 into main Jul 4, 2026
3 checks passed
@JumpLink
JumpLink deleted the web/app-web-learn-nav branch July 4, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant